<div id="joblist" class="mask selecter hide " style="display:none;height:100%; width:auto;right: 0;top:0;">
<div class="mask_wap_bg" style=" background-color: rgba(51, 51, 51, 0.8); height:100%;width:100%; position:fixed;left:0px;top:0px;bottom:0px;right:0px;"></div>

<div class="f_body" style="float: right; background: none repeat scroll 0% 0% transparent; width: 280px;">
<h2 style="transform: translate(0px, 0px); transition-duration: 0.4s; transition-timing-function: ease; transform-style: preserve-3d; backface-visibility: hidden;">职位类别
<button class="ok selectorOk" onclick="realy();">确定</button>
<button class="clear_sub clear_sub_gb" onclick="Close('job');">关闭</button>
<button class="clear_sub clear_sub_qic" onclick="removes();">清除</button> 
</h2>

<div class="contentbody position" style="transform: translate(0px, 0px); transition-duration: 0.4s; transition-timing-function: ease; transform-style: preserve-3d; backface-visibility: hidden;">
{yun:}foreach item=v from=$job_index{/yun}
<dl class="lookshow onelist" id="job{yun:}$v{/yun}" style="position:relative">
<dt class="current position" onclick="checkjob1('{yun:}$v{/yun}','job');">{yun:}$job_name[$v]{/yun}</dt>
<dd id="joblist{yun:}$v{/yun}" class="lookhide" style="display: none;">
    {yun:}foreach item=val from=$job_type[$v]{/yun}
    <ul id="u2000" style="position:relative;" data-c="show">
    <li onclick="checkjob2('{yun:}$val{/yun}','job');" class="contentbody_li"><i class="contentbody_li_icon fa fa-plus-square"></i>{yun:}$job_name[$val]{/yun}</li>
    <div class="post_show_three" id="jobpost{yun:}$val{/yun}" style="display: none;">
        <li>
        <input id="r{yun:}$val{/yun}" data="{yun:}$job_name[$val]{/yun}" type="checkbox" value="{yun:}$val{/yun}" name="jobclassone" onclick="checked_input('{yun:}$val{/yun}');">
        <label for="r{yun:}$val{/yun}" style="margin-left:5px;">全部</label>
        </li>
        {yun:}foreach item=value from=$job_type[$val]{/yun}
        <li>
        <input id="r{yun:}$value{/yun}" data="{yun:}$job_name[$value]{/yun}" type="checkbox" value="{yun:}$value{/yun}" class="one{yun:}$val{/yun}" name="jobclass" onclick="checked_input('{yun:}$value{/yun}');">
        <label for="r{yun:}$value{/yun}" style="margin-left:5px;">{yun:}$job_name[$value]{/yun}</label>
        </li>
        {yun:}/foreach{/yun}
    </div>
    </ul>
    {yun:}/foreach{/yun}
</dd>
</dl>
{yun:}/foreach{/yun}
</div>
</div>
</div>
<div id="citylist" class="mask selecter hide " style="display:none;height:100%; width:auto;right: 0;top:0;">
<div class="mask_wap_bg" style=" background-color: rgba(51, 51, 51, 0.8); height:100%;width:100%; position:fixed;left:0px;top:0px;bottom:0px;right:0px;"></div>

<div class="f_body" style="float: right; background: none repeat scroll 0% 0% transparent; width: 280px;">
<h2 style="transform: translate(0px, 0px); transition-duration: 0.4s; transition-timing-function: ease; transform-style: preserve-3d; backface-visibility: hidden;">城市类别
<button class="ok selectorOk" onclick="realycity();">确定</button>
<button class="clear_sub clear_sub_gb" onclick="Close('city');">关闭</button>
<button class="clear_sub clear_sub_qic" onclick="removescity();">清除</button> 
</h2>

<div class="contentbody position" style="transform: translate(0px, 0px); transition-duration: 0.4s; transition-timing-function: ease; transform-style: preserve-3d; backface-visibility: hidden;">
{yun:}foreach item=v from=$city_index{/yun}
<dl class="lookshow onelist" id="city{yun:}$v{/yun}" style="position:relative">
<dt class="current position" onclick="checkjob1('{yun:}$v{/yun}','city');">{yun:}$city_name[$v]{/yun}</dt>
<dd id="citylist{yun:}$v{/yun}" class="lookhide" style="display: none;">
    {yun:}foreach item=val from=$city_type[$v]{/yun}
    <ul id="u2000" style="position:relative;" data-c="show">
    <li onclick="checkjob2('{yun:}$val{/yun}','city');" class="contentbody_li"><i class="contentbody_li_icon fa fa-plus-square"></i>{yun:}$city_name[$val]{/yun}</li>
    <div class="post_show_three" id="citypost{yun:}$val{/yun}" style="display: none;">
        <li>
        <input id="rcity{yun:}$val{/yun}" data="{yun:}$city_name[$val]{/yun}" type="checkbox" value="{yun:}$val{/yun}" name="cityclassone" onclick="checked_input_city('{yun:}$val{/yun}','city');">
        <label for="rcity{yun:}$val{/yun}" style="margin-left:5px;">全部</label>
        </li>
        {yun:}foreach item=value from=$city_type[$val]{/yun}
        <li>
        <input id="rcity{yun:}$value{/yun}" data="{yun:}$city_name[$value]{/yun}" type="checkbox" value="{yun:}$value{/yun}" class="onecity{yun:}$val{/yun}" name="cityclass" onclick="checked_input_city('{yun:}$value{/yun}','city');">
        <label for="rcity{yun:}$value{/yun}" style="margin-left:5px;">{yun:}$city_name[$value]{/yun}</label>
        </li>
        {yun:}/foreach{/yun}
    </div>
    </ul>
    {yun:}/foreach{/yun}
</dd>
</dl>
{yun:}/foreach{/yun}
</div>
</div>
</div>
<script>
function checkshowjob(type) {
    window.show_scrolltop = document.body.scrollTop;
    document.body.scrollTop = 0;	
	$("#"+type+"list").show();
	checkhide('info'); 	
}
function checkhide(id){ 
	$("#"+id+"button").show();
	$("#"+id).hide();
}
function checkjob1(id,type){
	var style=$("#"+type+"list"+id).attr("style");
	$(".onelist").addClass("lookshow");
	$(".lookhide").attr("style","display: none;");
	if(style=="display: none;"){
		$("#"+type+"list"+id).show();
		$("#"+type+id).removeClass("lookshow");
	}
}
function checkjob2(id,type){
	
	var style=$("#"+type+"post"+id).attr("style");
	$(".post_show_three").attr("style","display: none;");
	if(style=="display: none;"){
		$("#"+type+"post"+id).show();
	}
} 

function checked_input(id){
	var one=$("input[name='jobclassone']:checked").val();
	var name=$("#r"+id).attr('name');
	if($("#r"+id).is(':checked')) {
		$(".one"+id).attr('checked',false); 
		$(".one"+id).attr('disabled','disabled');
	}else{
		$(".one"+id).attr("checked",false);
		$(".one"+id).attr('disabled',false);
	}
	var one_length=$("input[name='jobclassone']:checked").length;
	var check_length = $("input[name='jobclass']:checked").length;
	if((check_length+one_length)>5){
		$("#joblist").hide();	
		layermsg('您最多只能选择五个！',2,function(){
			$("#joblist").show();
				$("#r"+id).attr("checked",false);
				$(".one"+id).attr("checked",false);
				$(".one"+id).attr('disabled',false);
			});
	}
}
function realy() {
	var info="";
	var value=""; 
	$("input[name='jobclass']:checked").each(function(){
		var obj = $(this).val();
		var name = $(this).attr("data");
		if(info==""){
			info=obj;
			value=name;
		}else{
			info=info+","+obj;
			value=value+","+name;
		}
	})
	$("input[name='jobclassone']:checked").each(function(){
		obj = $(this).val();
		name = $(this).attr("data");
		if(info==""){
			info=obj;
			value=name;
		}else{
			info=info+","+obj;
			value=value+","+name;
		}
	})
	
	if(info==""){
		layermsg("请选择职位类别！");return false;
	}else{
		$("#job_classid").val(info);
		$("#wapexpect").html(value);
		$("#jobclassbutton").val(value);
		Close("job");
	}
}
function removes(){
	$("#jobclassbutton").val("请选择职位类别");
	$("#job_classid").val(""); 
	$(".onelist").attr("class","onelist lookshow");
	$(".onelist>.lookhide").hide();
	$(".post_show_three").hide();
	$("input[name='jobclass']").removeAttr("checked");
	$("input[name='jobclassone']").removeAttr("checked");
}
function Close(type) {
    document.body.scrollTop = window.show_scrolltop;
	$("#"+type+"list>.onelist").attr("class","onelist lookshow");
	$("#"+type+"list>.onelist>.lookhide").hide();
	$("#"+type+"list>.post_show_three").hide();
	$("#"+type+"list").hide(); 
}
function realycity() {
	var info="";
	var value=""; 
	$("input[name='cityclass']:checked").each(function(){
		var obj = $(this).val();
		var name = $(this).attr("data");
		if(info==""){
			info=obj;
			value=name;
		}else{
			info=info+","+obj;
			value=value+","+name;
		}
	})
	$("input[name='cityclassone']:checked").each(function(){
		obj = $(this).val();
		name = $(this).attr("data");
		if(info==""){
			info=obj;
			value=name;
		}else{
			info=info+","+obj;
			value=value+","+name;
		}
	})
	
	if(info==""){
		layermsg("请选择城市类别！");return false;
	}else{
		$("#city_classid").val(info);
		$("#wapexpect").html(value);
		$("#cityclassbutton").val(value);
		Close("city");
	}
}
function removescity(){
	$("#cityclassbutton").val("请选择城市类别");
	$("#city_classid").val(""); 
	$(".onelist").attr("class","onelist lookshow");
	$(".onelist>.lookhide").hide();
	$(".post_show_three").hide();
	$("input[name='cityclass']").removeAttr("checked");
	$("input[name='cityclassone']").removeAttr("checked");
}

function checked_input_city(id,type){
	var one=$("input[name='"+type+"classone']:checked").val();
	var name=$("#r"+id).attr('name');
	if($("#r"+type+id).is(':checked')) {
		$(".one"+type+id).attr('checked',false); 
		$(".one"+type+id).attr('disabled','disabled');
	}else{
		$(".one"+type+id).attr("checked",false);
		$(".one"+type+id).attr('disabled',false);
	}
	var one_length=$("input[name='"+type+"classone']:checked").length;
	var check_length = $("input[name='"+type+"class']:checked").length;
	if((check_length+one_length)>5){
		$("#"+type+"list").hide();	
		layermsg('您最多只能选择五个！',2,function(){
			$("#"+type+"list").show();
				$("#r"+type+id).attr("checked",false);
				$(".one"+type+id).attr("checked",false);
				$(".one"+type+id).attr('disabled',false);
			});
	}
}
</script>